<?php

/*
 * Created by generator
 *
 */

/**
 * Recupere la liste des enregistrements
 * @param object $db database object
 * @return array of data
 */
if (!function_exists('getAllLienActivitesAdherentssFromDB')) {
	function getAllLienActivitesAdherentssFromDB($db) {
		$sql = "SELECT xaaidact, xaaidadh from gyaxaa ";
		$query = $db->query($sql);

		// recuperer les enregistrements
		$records = array();
		foreach ($query->result_array() as $row) {
			$records[] = $row;
		}
		return $records;
	}
}


/**
 * Insere un nouvel enregistrement
 * @param object $db database object
 * @param string ...
 * @return number identifiant
 */
if (!function_exists('insertNewLienActivitesAdherents')) {
	function insertNewLienActivitesAdherents($db, $xaaidact, $xaaidadh) {
		$data=array( 'xaaidact'=>$xaaidact, 'xaaidadh'=>$xaaidadh );
		$db->insert('gyaxaa',$data);
		return $db->insert_id();
	}
}


/**
 * Suppression d'un enregistrement
 */
if (!function_exists('deleteLienActivitesAdherents')) {
	function deleteLienActivitesAdherents($db, $xaaidact, $xaaidadh) {
		$sql = "delete from gyaxaa where xaaidact=? and xaaidadh=?";
		$query = $db->query($sql, array((int)$xaaidact, (int)$xaaidadh));
	}
}


/**
 * Recupere les informations d'un enregistrement
 * @param object $db database object
 * @param int id de l'enregistrement
 * @return array
 */
if (!function_exists('getLienActivitesAdherentsRow')) {
	function getLienActivitesAdherentsRow($db, $xaaidact, $xaaidadh) {
		$sql = "select xaaidact, xaaidadh from gyaxaa " .
		"where xaaidact=? and xaaidadh=?";
		$query = $db->query($sql, array((int)$xaaidact, (int)$xaaidadh));
		if ($query->num_rows() == 0) {
			return null;
		}
		return $query->row_array();
	}
}

	/***************************************************************************
	 * USER DEFINED FUNCTIONS
	 ***************************************************************************/


?>
